import React from 'react';
import { connect } from 'react-redux';
import 'date-util';
import { changeCount } from './action';
import {Button} from 'antd';

/**
 * demo1
 */

@connect(
	state => ({ demo1Store: state.demo1Store }),
	{ changeCount }
)
class demo1 extends React.Component {
	componentDidMount() {
	}

	add = () => {
		let demo1 = this.props.demo1Store;
		this.props.changeCount(demo1.count + 1);
	};

	dec = () => {
		this.props.changeCount(this.props.demo1Store.count - 1);
	};


	des = () => {
		return (
			<div className="data-top1">

			</div>
		)
	}

	render() {
		return (
			<div>
				<Button onClick={this.add}>增加</Button>
				<span>{this.props.demo1Store.count}</span>
			</div>
		);
	}
}

export default demo1;
